from selenium import webdriver

driver = webdriver.Chrome()

driver.get('http://cdn1.python3.vip/files/selenium/test1.html')

# 通过id属性进行查找
element = driver.find_element_by_xpath('//div[@id="us"]')
print(element.text)

# 通过class属性查找
elements = driver.find_elements_by_xpath('//select[@class="multi_choice"]')

for elemen in elements:
    print(elemen.text)

# 其他属性也可通过@符号进行使用
elements1 = driver.find_elements_by_xpath('//*[@multiple]')

for elemen1 in elements:
    print(elemen1.text)